package ru.reaperoq.database

import org.jetbrains.exposed.sql.Database
import ru.reaperoq.schema.ComponentsService
import ru.reaperoq.schema.ComputersService
import ru.reaperoq.schema.LocationsService
import ru.reaperoq.schema.UserService

object Database {
    private val database = Database.connect(
        url = "jdbc:pgsql://localhost:5432/inventory",
        user = "postgres",
        driver = "com.impossibl.postgres.jdbc.PGDriver",
        password = "postgres"
    )

    val userService = UserService(database)
    val componentsService = ComponentsService(database)
    val locationsService = LocationsService(database)
    val computersService = ComputersService(database)
}